﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Projet_IMA.Environnement;
using Projet_IMA.Base;
using Projet_IMA.Unsafe;
using Projet_IMA.Habillage.Material;

namespace Projet_IMA.Object3D
{
    public abstract class Object3DBase
    {
        protected float pas;
        protected CachePoint cache;
        protected bool modified;
        protected Scene3D scene;
        protected MaterialBase material;

        public Object3DBase(float pas, MaterialBase material)
        {
            this.pas = pas;
            this.modified = true;
            this.material = material;
            this.cache = new CachePoint();
        }

        public CachePoint GetCache()
        {
            if (this.modified)
            {
                this.MakeCache();
                this.modified = false;
            }

            return cache;
        }

        public void setScene(Scene3D scene)
        {
            this.scene = scene;
        }

        protected abstract void MakeCache();

        public abstract V3 getNormalOfPoint(V3 point);

    }
}
